from django.db import models

# Create your models here.

class Ment(models.Model):
    ment_name = models.CharField(max_length=32)


class Employee(models.Model):
    s_name = models.CharField(max_length=32)
    s_id = models.CharField(max_length=32,unique=True)
    password=models.CharField(max_length=32,verbose_name='用户名密码')
    quanxian = models.CharField(max_length=10)
    sex = models.CharField(max_length=32)
    age = models.IntegerField()
    phone = models.CharField(max_length=32)
    position = models.CharField(max_length=32)
    email = models.EmailField(max_length=32,null=True)
    dizhi = models.CharField(max_length=128)
    birthday = models.DateTimeField(auto_now=True)
    ment = models.ForeignKey(to='Ment',to_field='id',related_name='m',on_delete=models.CASCADE)


class classes(models.Model):
    morning = models.CharField(max_length=32)
    night = models.CharField(max_length=32)
    weektim = models.IntegerField()

class signintime(models.Model):
    time = models.DateTimeField(auto_now=True)
    emp = models.ForeignKey(Employee, on_delete=models.CASCADE)

class signouttime(models.Model):
    time = models.DateTimeField(auto_now=True)
    emp = models.ForeignKey(Employee, on_delete=models.CASCADE)


